﻿#region LGPL License
/*----------------------------------------------------------------------------
* This file (Features\SystemEventWatcher\ISystemEventWatcher.cs) is part of CiviKey. 
*  
* CiviKey is free software: you can redistribute it and/or modify 
* it under the terms of the GNU Lesser General Public License as published 
* by the Free Software Foundation, either version 3 of the License, or 
* (at your option) any later version. 
*  
* CiviKey is distributed in the hope that it will be useful, 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
* GNU Lesser General Public License for more details. 
* You should have received a copy of the GNU Lesser General Public License 
* along with CiviKey.  If not, see <http://www.gnu.org/licenses/>. 
*  
* Copyright © 2007-2009, 
*     Invenietis <http://www.invenietis.com>,
*     In’Tech INFO <http://www.intechinfo.fr>,
* All rights reserved. 
*-----------------------------------------------------------------------------*/
#endregion

//****************************************************
//Author : Antoine Blanchet
//Mail : ablanchet@intechinfo.fr
//Date : 24-06-2009
//****************************************************
using System;
using System.Collections.Generic;
using System.Text;
using CK;
using CK.Plugin;
using System.Diagnostics;

namespace SystemEventWatcher
{
    public interface ISystemEventWatcher : ICKService
    {
        /// <summary>
        /// Fires when the foreground window changes
        /// </summary>
        event ChangeForegroundWindowEventHandler ChangeForegroundWindow;
        /// <summary>
        /// Fires when a process is stopped
        /// </summary>
        event ProcessStopEventHandler ProcessStop;
        /// <summary>
        /// Fires when a process is started
        /// </summary>
        event ProcessStartEventHandler ProcessStart;
    }

    public delegate void ChangeForegroundWindowEventHandler(Object sender, ChangeForegroundWindowEventArgs e);
    public delegate void ProcessStopEventHandler(Object sender, ProcessEventArgs e);
    public delegate void ProcessStartEventHandler(Object sender, ProcessEventArgs e);

    //public class ChangeForegroundWindowEventArgs : EventArgs
    //{
    //    int _processID;

    //    public int processID
    //    {
    //        get { return _processID; }
    //    }
    //    public ChangeForegroundWindowEventArgs(int id)
    //    {
    //        _processID = id;
    //    }
    //}
    public class ChangeForegroundWindowEventArgs : EventArgs
    {
        Process _process;

        public int processID
        {
            get { return _process.Id; }
        }
        public ChangeForegroundWindowEventArgs(Process process)
        {
            _process = process;
        }
    }
    public class ProcessEventArgs : EventArgs
    {
        int _processID;
        public int processID
        {
            get { return _processID; }
        }
        public ProcessEventArgs(int id)
        {
            _processID = id;
        }
    }
}

